home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / LANG / ADA / GNAT / !gcc / adainc / 6 / ads / s-tasuti < prev    next >
Text File  |  1996-02-12  |  7KB  |  149 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                 GNU ADA RUNTIME LIBRARY (GNARL) COMPONENTS               --
  4. --                                                                          --
  5. --              S Y S T E M . T A S K I N G . U T I L I T I E S             --
  6. --                                                                          --
  7. --                                  S p e c                                 --
  8. --                                                                          --
  9. --                             $Revision: 1.23 $                            --
  10. --                                                                          --
  11. --      Copyright (C) 1991,1992,1993,1994,1995 Florida State University     --
  12. --                                                                          --
  13. -- GNARL is free software; you can  redistribute it  and/or modify it under --
  14. -- terms of the  GNU General Public License as published  by the Free Soft- --
  15. -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
  16. -- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
  17. -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
  18. -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
  19. -- for  more details.  You should have  received  a copy of the GNU General --
  20. -- Public License  distributed with GNARL; see file COPYING.  If not, write --
  21. -- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
  22. -- MA 02111-1307, USA.                                                      --
  23. --                                                                          --
  24. -- As a special exception,  if other files  instantiate  generics from this --
  25. -- unit, or you link  this unit with other files  to produce an executable, --
  26. -- this  unit  does not  by itself cause  the resulting  executable  to  be --
  27. -- covered  by the  GNU  General  Public  License.  This exception does not --
  28. -- however invalidate  any other reasons why  the executable file  might be --
  29. -- covered by the  GNU Public License.                                      --
  30. --                                                                          --
  31. -- GNARL was developed by the GNARL team at Florida State University. It is --
  32. -- now maintained by Ada Core Technologies Inc. in cooperation with Florida --
  33. -- State University (http://www.gnat.com).                                  --
  34. --                                                                          --
  35. ------------------------------------------------------------------------------
  36.  
  37. --  This package provides RTS Internal Declarations.
  38. --  These declarations are not part of the GNARLI
  39.  
  40. with Unchecked_Conversion;
  41.  
  42. package System.Tasking.Utilities is
  43.  
  44.    --  Entry queue related types
  45.    --  ??? Not currently used.  Should it be?
  46.  
  47.    type Server_Kind is (Task_Server, PO_Server);
  48.  
  49.    type Server_Record (Kind : Server_Kind := Task_Server) is record
  50.       case Kind is
  51.          when Task_Server =>
  52.             Called_Task            : Task_ID;
  53.             Acceptor_Prev_Call     : Entry_Call_Link;
  54.  
  55.             Acceptor_Prev_Priority : Rendezvous_Priority;
  56.             --  For a task servicing a task entry call,
  57.             --  information about the most recent prior call being serviced.
  58.             --   Not used for protected entry calls;
  59.             --  this function should be performed by GNULLI ceiling locking.
  60.  
  61.          when PO_Server =>
  62.             Called_PO : Protection_Access;
  63.  
  64.       end case;
  65.    end record;
  66.  
  67.    function ATCB_To_Address is new
  68.      Unchecked_Conversion (Task_ID, System.Address);
  69.  
  70.    procedure Vulnerable_Complete_Activation
  71.      (T : Task_ID;
  72.       Completed : Boolean);
  73.    --  Completes the activation by signaling its children.
  74.    --  Completed indicates a call when the task has completed.
  75.    --  Does not defer abortion (unlike Complete_Activation).
  76.  
  77.    procedure Check_Exception (T : Task_ID := Self);
  78.    pragma Inline (Check_Exception);
  79.    --  Raises an exception pending on Self.
  80.    --  Used to delay exceptions until abortion is undeferred.
  81.  
  82.    procedure Complete_on_Sync_Point (T : Task_ID);
  83.    --  If a task is suspended on an accept, select, or entry call
  84.    --  (but not yet *in* rendezvous) then complete the task.
  85.  
  86.    procedure Reset_Priority
  87.      (Acceptor_Prev_Priority : Rendezvous_Priority;
  88.       Acceptor               : Task_ID);
  89.    pragma Inline (Reset_Priority);
  90.    --  Reset the priority of a task completing an accept statement to
  91.    --  the value it had before the call.
  92.  
  93.    procedure Terminate_Alternative;
  94.    --  Called when terminate alternative is selected.
  95.    --  Waits for the parent to terminate the task
  96.    --  or a caller to select an accept alternative.
  97.    --  Assumes that abortion is deferred when called.
  98.  
  99.    procedure Complete (Target : Task_ID);
  100.    --  Complete task and act on pending abortion.
  101.  
  102.    ---------------------------------
  103.    -- Task_Stage Related routines --
  104.    ---------------------------------
  105.  
  106.    procedure Make_Independent;
  107.    --  Remove a task from the master hierarchy.  This includes setting the
  108.    --  master ID to zero (no master) and removing the task from the
  109.    --  All_Tasks_List (which is used to search for masters and dependents).
  110.    --  No master will wait on the termination of an independent task;
  111.    --  such tasks may still be running when the program terminates, at which
  112.    --  point they will be killed by the underlying operating system.
  113.    --  This is a dangerous operation, and should only be used on tasks
  114.    --  that require no finalization.  Independent tasks are intended only
  115.    --  for internal use by the GNARL, to prevent such internal tasks from
  116.    --  preventing a user task from terminating.
  117.  
  118.    ------------------------------------
  119.    -- Task Abortion related routines --
  120.    ------------------------------------
  121.  
  122.    procedure Abort_To_Level (Target : Task_ID; L : ATC_Level);
  123.    --  Abort a task to a specified ATC level.
  124.  
  125.    procedure Abort_Handler (Context : System.Task_Primitives.Pre_Call_State);
  126.    --  Handler to be installed at initialization; it is invoked by a task
  127.    --  when it is the target of an Abort_Task low-level operation.
  128.  
  129.    procedure Abort_Dependents (Abortee : Task_ID);
  130.    --  Propagate the abortion of a parent into its children.
  131.  
  132.    -----------------------------------------------
  133.    --  RTS routine to be used for pragma assert --
  134.    -----------------------------------------------
  135.  
  136.    function Runtime_Assert_Shutdown (Msg : in String) return boolean;
  137.    --  This function is used to shut down the runtime when there is
  138.    --  an assertion error to be raise through "pragma Assert"
  139.    --  Usage should be either
  140.    --    pragma Assert (Runtime_Assert_Shutdown ("..."));
  141.    --    --  unconditional shutdown
  142.    --  or
  143.    --    pragma Assert
  144.    --      (ASSERT_CONDITION or else Runtime_Assert_Shutdown ("..."));
  145.    --    --  conditional shutdown. Shut down the runtime only when the
  146.    --    --  ASSERT_CONDITION fails.
  147.  
  148. end System.Tasking.Utilities;
  149.